{% if page.title %}
  {% capture title %}{{ page.title }} | {{ site.title }}{% endcapture %}
{% else %}
  {% capture title %}{{ site.title }}{% endcapture %}
{% endif %}

{% if page.excerpt %}
  {% capture description %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% endcapture %}
{% else %}
  {% capture description %}{{ site.description }}{% endcapture %}
{% endif %}

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="{{ description }}">
  <meta name="keywords" content="{{ site.keywords | array_to_sentence_string }}">
  <meta name="author" content="{{ title | escape }}">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="theme-color" content="#f5f5f5">

  <!-- Twitter Tags -->
  <meta name="twitter:card" content="summary">
  <meta name="twitter:title" content="{{ title | escape }}">
  <meta name="twitter:description" content="{{ description | escape }}">
  {% if page.image.feature %}
    <meta property="twitter:image" content="{{ site.url }}/img/{{ page.image.feature }}">
  {% else %}
    <meta property="twitter:image" content="{{ site.url }}/img/leonids-logo.png">
  {% endif %}

  <!-- Open Graph Tags -->
  <meta property="og:type" content="blog">
  <meta property="og:url" content="{{ site.url }}{{ page.url }}">
  <meta property="og:title" content="{{ title | escape }}">
  <meta property="og:description" content="{{ description | escape }}">
  {% if page.image.feature %}
    <meta property="og:image" content="{{ site.url }}/img/{{ page.image.feature }}">
  {% else %}
    <meta property="og:image" content="{{ site.url }}/img/leonids-logo.png">
  {% endif %}
  <title>{{ title }}</title>

  <!-- CSS files -->
  <link rel="stylesheet" href="{{ site.url }}/css/font-awesome.min.css">
  <link rel="stylesheet" href="{{ site.url }}/css/main.css">

  <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.url }}">
  <link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | prepend: site.url }}" />

  <!-- Icons -->
  <!-- 16x16 -->
  <link rel="shortcut icon" href="{{ site.url }}/favicon.ico">
  <!-- 32x32 -->
  <link rel="shortcut icon" href="{{ site.url }}/favicon.png">
</head>
